<?php
namespace Guider\Model;
use Think\Model;

class CommentModel extends Model {
	protected $_auto = [
		["create_time", "time", 1, "function"],
		["update_time", "time", 2, "function"],
	];
	protected $_validate = [
		["id", "require", "ID必须填写!"],
		["user_id", "require", "评论人必须填写!"],
		["order_id", "require", "订单必须填写!"],
		["score", "require", "评分必须填写!"],
		["is_complusive", "require", "是否强制购物必须填写!"],
		["is_guide", "require", "有无出游指导必须填写!"],
		["is_service", "require", "旅社人员是否当面了解情况必须填写!"],
		["is_satisfy", "require", "对本次旅游是否满意必须填写!"],
		["is_contract", "require", "是否按合同规定内容完成必须填写!"],
		["content", "require", "评价内容必须填写!"],
		["create_time", "require", "创建时间必须填写!"],
		["update_time", "require", "更新时间必须填写!"],
	];
	public $excel = false;
	public $update = false;
	public $delete = false;
	public $fieldMap = [
		"id" => [
			"type" => "input",
			"name" => "ID",
			"show" => true,
			"search" => true,
			"input" => false,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
			"update_specify" => "",
			"detail_specify" => "",
		],
		"user_id" => [
			"type" => "foreign",
			"name" => "评论人",
			"show" => true,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "user,id,name,input",
			"list_specify" => "",
			"update_specify" => "",
			"detail_specify" => "",
		],
		"commented_user_id" => [
			"type" => "input",
			"name" => "被评论人",
			"show" => false,
			"search" => false,
			"input" => false,
			"required" => false,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
			"update_specify" => "",
			"detail_specify" => "",
		],
		"order_id" => [
			"type" => "foreign",
			"name" => "订单",
			"show" => true,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "customized_guider,id,name,select",
            "list_specify"=>'<td class="center"><a href="{:U($vo[\'order_type\'].\'/detail\', [\'id\'=>$vo[\'order_id\']])}">{:D("Customized_guider")->find($vo["order_id"])["name"]}</a></td>',
			"update_specify" => "",
			"detail_specify" => "",
		],
		"order_type" => [
			"type" => "input",
			"name" => "订单类型",
			"show" => false,
			"search" => false,
			"input" => false,
			"required" => false,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
			"update_specify" => "",
			"detail_specify" => "",
		],
		"score" => [
			"type" => "input",
			"name" => "评分",
			"show" => true,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
			"update_specify" => "",
			"detail_specify" => "",
		],
		"is_complusive" => [
			"type" => "input",
			"name" => "强制购物",
			"show" => true,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
			"update_specify" => "",
			"detail_specify" => "",
		],
		"is_guide" => [
			"type" => "input",
			"name" => "出游指导",
			"show" => true,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
			"update_specify" => "",
			"detail_specify" => "",
		],
		"is_service" => [
			"type" => "input",
			"name" => "当面沟通",
			"show" => true,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
			"update_specify" => "",
			"detail_specify" => "",
		],
		"is_satisfy" => [
			"type" => "input",
			"name" => "是否满意",
			"show" => true,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
			"update_specify" => "",
			"detail_specify" => "",
		],
		"is_contract" => [
			"type" => "input",
			"name" => "执行合同",
			"show" => true,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
			"update_specify" => "",
			"detail_specify" => "",
		],
		"content" => [
			"type" => "input",
			"name" => "评价内容",
			"show" => false,
			"search" => false,
			"input" => true,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
			"update_specify" => "",
			"detail_specify" => "",
		],
		"create_time" => [
			"type" => "datetime",
			"name" => "评论时间",
			"show" => false,
			"search" => false,
			"input" => false,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
			"update_specify" => "",
			"detail_specify" => "",
		],
		"update_time" => [
			"type" => "datetime",
			"name" => "更新时间",
			"show" => false,
			"search" => false,
			"input" => false,
			"required" => true,
			"detail" => true,
			"excel" => true,
			"content" => "",
			"list_specify" => "",
			"update_specify" => "",
			"detail_specify" => "",
		],
	];
}